#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main () {
	char szTime[32];
	time_t tmtime;
	struct tm *tmi;
	//取当前时间
	time(&tmtime);
	tmi = localtime(&tmtime);
	sprintf(szTime, "%04d", 1900 + tmi->tm_year);
	unsigned short int iYear = atoi(szTime);
	printf("szTime = %s\n", szTime);
	printf("%02d%02d%02d%02d%02d%02d%02d\n",
	       iYear & 0x00ff,
	       iYear >> 8,
	       1 + tmi->tm_mon,
	       tmi->tm_mday,
	       tmi->tm_hour,
	       tmi->tm_min,
	       tmi->tm_sec
	      );
	return 0;
}
